//
//  SouSuoViewController.m
//  ShiWuPai
//
//  Created by macmacpro on 16/11/25.
//  Copyright © 2016年 QQ:244987427. All rights reserved.
//

#import "SouSuoViewController.h"
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width

@interface SouSuoViewController ()
@property (nonatomic, strong) UISearchBar *foodSearchBar;

@end

@implementation SouSuoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _foodSearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH - 25, 64)];
    _foodSearchBar.delegate = self;
    _foodSearchBar.placeholder = @"请输入食物名称";
    UIImageView *searchView = [UIImageView new];
    searchView.image = [UIImage imageNamed:@"ic_feed_search_selected_20x20_@2x.png"];
    searchView.frame = CGRectMake(SCREEN_WIDTH - 25, 0, 20, 20);
    [_foodSearchBar addSubview:searchView];
    
    self.navigationItem.titleView = _foodSearchBar;
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"ic_back_dark_20x22_@2x.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:self action:@selector(fanHui)];
}



- (void)viewWillAppear:(BOOL)animated{
    self.tabBarController.tabBar.hidden = YES;
    [super viewWillAppear:animated];
    
}

- (void)fanHui {
    [self.navigationController popToRootViewControllerAnimated:YES];
}



@end
